implement restoration of a SchemaDocument even if it's a key of a dict

if a SD is not regitered it is restore as dict
if a SD is registered it is restore as SD
but when a nonregisterd SD have a key which is a registerd SD
it was restore as dict.
from now it is restore as SD
Merge branch 'master' into fix_restore_sd_in_dict
replace a loop for updating SchemaDocument self (a dict) by dict.update
method
replace hard coded reference to structure['_type'] when register a SD
privatize method generate_doc
remove ugly print
fix test test_restore_in_dict

hector the dog is not registered so it should not be a SchemaDocument when it
come frem the mongo database. it must be a dict
remove type_field class variable from Document

as it is now in SchemaDocument
generate_doc does not return a dict anymore but modify self instead
fix test where to_json method is compare to a string

as in pyhton and json the order of the keys is not garantee,
we cannot compare to_json output directly with a hardcoded string.
I'ts better to transform both the hardcoded dtring and the to_json
output in json with the json library and compare the 2 resulting objects
Merge branch 'fix_test_json' into fix_restore_sd_in_dict