Fixed loading and saving to DB, jquery Deferreds to the rescue