Major refactoring of data-store.js.   Non-breaking changes though