DAO function to list all foreign key references to a table

This patch also begins to formally describe the entity_id/entity_table
references, but we need some way to describe the restrictions on the
possible values of entity_table for each DAO.