Began implementing integration tests

`test/integration.js` is a starting point for integration testing.

Other changes are updating the client module and custom hapi errors.

Remaining TODO

* remote testing (including output)
* more flow tests

@jbonacci