throw an exception if the value is not a dict
more tests on the insert
throw error on update if it's a bad value
Merge pull request #18 from brunobord/value-error-exception

On insert or update, throw a BadValueError exception if it's a bad value