Cleaned up test files.

The json schema has been put in a separate file.
Added errorHandler method.

Allow the user to define custom errorHandler behaviour.