Add backlogged tests for models, controllers, and mailers. Also small random fixes found by those tests.