Moved application startup code (Global.asax) to code-behind

Also deleted a lot of commented out code