Fixed bugs with authorization
Created separate angular-pouchdb factory and refactored events in this factory
Fixed authentication persistence issue