Moving business logic for dashboard from controller/view into model
Merging in JJY's work to master branch