Initial commit for views + Refactoring

Refactor so that stuff that requires database and session occur in the model
instead of in the controllers

Refactor so that we use case classes instead of tuple.