Clean up PK handling so that custom PKs work, make ancestor queries mostly work. Write a test to prove that PK in queries need work