Refactored eventstore-lite.js.