Refactor misc. models

Grouping attribute constraints and updating queries.

Also other minor refactors to help keep Hound away in the future.