errors: add custom errors and expose via exports.errors
agent: events, custom errors, and improved codec lookup
Merge branch 'feature/events'

* feature/events:
  agent: events, custom errors, and improved codec lookup
  errors: add custom errors and expose via exports.errors
agent: [connect] support for reconnnect

if connect wasn't closed manually or because of auth error,
  unlimited reconnections are permitted.

- settings: enabled('reconnect'), set('reconnect delay', 3000)
- events: gateway:reconnect on successful reconnect. emitted after gateway:connect
test: [agent] should be able to reconnect
Merge branch 'feature/reconnect'

* feature/reconnect:
  test: [agent] should be able to reconnect
  agent: [connect] support for reconnnect