Added docstrings to most functions.
Fixed some templating issues.
Reverted work on pagination, should go in a branch.
Made users.username unique.
Pulled out views into their own file.