mostly oauth fixes

This pull request fixes the annoying situation where the user would no longer be authenticated when the flask application would be restarted.

Also deleting some obsolete files and bringing a few more files up to date with the code style conventions.