Tiny clumps of cells show basic cognitive abilities, and some animals can remember things after losing their head