Replace use of tree.py with graph.py
 By providing a cache, this saves a lot of SQL queries (from 94 down
 to 7 when displaying the default pedigree)
make main_ids a property rather than a function, and cache it
Perserve the use of Persona_node (instead of numeric ids) as much
 as possible