Fixes #55: obj.to_dict() should do flush at first if the session cache is modified
Merge branch 'master' to 'orm': bugfix