Added error handling, tests and updated co

Uncaught exceptions are passed to next(), co updated to 1.5.1. Bumped
version to 0.3.1.