added custom errors.
added a defineModels function.
added a DocumentNotFound error.
added filter object support.
added model api.

This change makes the entire model api self-contained inside the models.js file, with the exception of the 'defineModel' function in the root of the library. That's fine; it means that using models are entirely an optional thing, but are just as easy to do as low-level database access. Provided the unit tests for this work out well, this should be ready to go shortly.
fixed typo.
fixed an issue passing in 'undefined' for name

If you passed in an undefined variable for name, it didn't detect it, therefore, it would never generate an id.
Fixed several issues with model support.
Added a model example file.
condensed the model example some.
switched from custom type checking, to a type checking lib.
added very basic unit test for defineModel.
added a note about a better type-checking lib.
added support for automatic model syncing.

Now, the database object emits a 'sync' event whenever the `sync` function is called. Models now listen for this sync function, and update themselves, if they are not dirty. This ensures that model objects will be as up to date as possible.

If you want to force a model instance to sync, you can call it's `sync()`, passing in the boolean `true`. This will force a sync, regardless of if the mode is dirty.
Fixed issues with the custom errors.
added model unit tests.

This includes fixes for issues discovered while writing them.
Updated the readme for documentation on the model api.
Merge pull request #6 from Morgul/ccase-model-api

Model API