Added jQuery promises to sync. Now save and fetch functions return promises. Tests should be revised as now they are copy-pasted and success handlers are replaced by done() functions.