Changed the _.throttle call to _.debounce

Now it works better with batches of db operations. Previously only the first
would get persisted to disk, and the rest would be ignored.