refactor Event.js and EventStore.js