im_ui.js re-write WIP

Moving toward a heavily object oriented model. Currently, pressing 'Enter' sets off a series of events that are entirely based on the new paradigm. All other functionality should remain working as I rebuild everything in place.