Add unit tests. All of them.

- Add unit tests for the main functionality of the site. Trivial
  or features better suited to end-to-end testing were skipped.
- Fix a small issue where users could leave feedback on task attempts
  that did not belong to them.