Fix self association issues in bake

This fixes 2 of the 3 issues in #4440. I'll make a separate issue for the foreign key constraints, as I feel it is worth discussing the interface before writing code.
I guess an ORM\Table will rarely be associated to itself in a parent/child way.