Added some tests (finally)
fixed nasty bug in loadRefs (triggered when loadRefs was called twice)
added dirty flag on object properties to prevent squashing by non-modified data