Update API to expose an event emitter instead of relying on undocument behaviour in the socket event-emitter which caused a lot of problems earlier on. Bump up version to v0.3.0.