Refactor from code review

- Replace references to instance variables in views to refer to new
  helper methods

- Move logic in views to controllers, models

- Add protection against several potential nil values

- Add null: false to several DB columns

- Clean up tests