Make Instance object properly update *metadata

Currently, the Instance object won't notice when metadata or
system_metadata has changed and thus won't include it in updates it
makes to the database.

We could make these two dicts full-fledged objects, but that's a bit
overkill for this purpose. Stash a copy of them every time we reset
our changes so that we can detect changes in save().

Note that this includes tests to some shelve tests which are now
wrong because they modify the instance's sys_meta prematurely.
Turns out, these are the tests that pointed out the need for
this tracking :)

Related to blueprint unified-object-model
Fixes bug 1201776

Change-Id: I3df462645979742379a41060cda5bb5084fddb20
Merge "Make Instance object properly update *metadata"