JavaScript key mapper