fix #12 fix #22 Validation framework in the model layer

- Models must now create a validate() method to validate the
  document before it is saved.
- Stack traces will only be added to the response if the server
  is not in production mode.
- Added "assertValidationError" method in base TestCase.