Server side authentication works!

Preliminary PR. Please comment heavily, as I don't think it's ready for merge quite yet.

I had to move around some functions to fix the circular imports.
Also, modified authentication decorator to account for permissions.
Finally, updated tests to reflect the changes.

NOTE: I had to do add in some dummy testing code into the `requires_authenticated_user` function as I'm not sure of the best way of doing this. Perhaps @moowiz could help out? :)

Fixes #47 
We can't really get around the client secret being known since it has to live with the application, though knowing it doesn't allow anybody to abuse the system I think.