Begin rewrite.
TODO: Finish authentication.
Implement authentication
Adjusted input filtering.
Merge branch 'master' into rewrite