Self-modifying systems in biology and cognitive science