Implement exceptions instead of errstr

Addresses #10.

Could use some code review.  Thanks!

David