Refactor a handful more models

Group attribute constraints by attribute, and update some database
queries for Rails 4.
Merge pull request #1690 from ferrous26/finders2

Refactor a handful more models