Implement error classes, see #16
update tests to expect specific error types
update error constructors so instanceof works properly. closes #16