A bit more javascript tweaking to eliminate redundencies and make things more re-usable around the key entry and map flow