Fix foreign keys for model associations

Add foreign_keys corresponding to the User model in project.rb and
submission.rb. This allows us to use delegations (from Submissions and
Projects to their respective Users).
Refactor some views

Remove logic from some views, add some methods to models