Moved stuff around.
Added isLoggedIn middleware.