Fix indentation of case ... when statements
Get rid of unnecessary line wraps

These line wraps are no longer needed after the indentation is fixed.
Reused existing local variable
Merge pull request #1688 from zhangsu/case_indentation_fix

Refactor GradersController#global_actions
Refactor a handful more models

Group attribute constraints by attribute, and update some database
queries for Rails 4.