Sync related fixes

- Fix a bug which caused the SyncManager to push some dirty objects more than once.
- Change the JSON converter behaviour regarding missing optional relationships - if the relation is missing, treat it as not-set relation, if the RemoteId is missing throw the exception.