Create AbstractUnitController class

Move the existing UnitController class out of the engine code.
Fix some bugs with controller logic hidden by lack of encapsulation of
logic.