move shared page stuff to maps.c

still not the perfect place for it, but better.
move table munging to tables.c
remove unnecessary assignment