WIP: First draft of authentication function. Depends on nonimplemented functionality in crypto
WIP: Fix importKey of pubkey
Auth challenge should get encrypted and submitted. Move and camelcase connection event handler functions
Proper first response of auth challenge
Error handling and logging in auth response
Handle authResponse properly
Attach listeners on incoming actions only after identity has been verified
Add TODO comment
Error handling when identities have no pubkey
Refactor onAuthChallenge with Q.all/spread. Remove unused onConnection handler
Slight restructuring of onAuthChallenge refactor
Refactor promise structure in connect
Set connection.verified after verification in both ends. Adjust log message on successful connection
Small bugfixes. Clean up log messages. Remove unnecessare call to Q.all
Refactor: Move connection establishment and auth to separate ConnectionHandler module
Merge with feature/authentication
Fix adding non-existing argument to trigger('resource'..)