Issue #14

Document model not setting the dirty flag when clearing keys, preventing
a subsequent save from storing the changes unless the force argument is
supplied.
Added some basic document tests, including tests for issue #14.