Compact, evented key-value cache in JavaScript