don't save the entire cortex data structure in memory, was making the population object use too much memory.

instead, just save cortex id's in population, and store separate docs in db for cortexes.
Fix bug with parent id being wrong