error handling tests

Get tests passing with new error handling code.

Also change `npm test` to something reasonable.