Error refactoring.

Fixed up a few error issues and refactored out the Error type.
Merge pull request #87 from benbjohnson/errors

Error refactoring