Code and comment cleanup, adding (untested) support for redirect based logins, and adding proper wrappers for important session methods.