Create new base class InputManager

Factor out common methods from KeyboardInputManager and
GravityInputManager into the base class.