JavaScript implementation of a dictionary/map