app states and protected nav

modified and cleaned up controller and enabled appstates
merged code, updates states, login-logout

tasks not done