Basic changes to main-controller.  Not working yet, but all the base functionality should be in place to now work with UI.