cleaned up login() much more readable now.
added support for Flask-Login extension.
Logout Added.  Changed main.html a bit.