Start of refactor.

- Move some logic out of routes into controllers.
- Rename 'submissions' to 'photos'.