Rewrote the order of Ajax function calls

This is the order of calls:
1. Checks if editor is dirty, sends POST request, memcache.set the data
2. Periodically sends GET request to get Json from memcache.get
3. editor.setData the following cached data

So far, it worked like how I expected, it's just that it refreshes way
too frequently and the cursor moves to the start too much that it's
impossible to type into it.