fix dirty checking of nested objects

store json when loading, and then compare json at end to determine
if a child object has changed.

fixes #42