Clean up exception definition

Use http://dustinsenos.com/articles/customErrorsInNode to improve
exception definitions.