Updated layout, base session check
Updated checks for login/registering, initial redirect code