Added some code to analyze foreign keys. Does not do anything yet
Improved base handling in BaseSelectorAttribute