before change main application object
refactor in identitymanager class. fix test. KZApplication object now authenticates with user/pass and with key