General fixes to inputmanager

Improved API for accessing inputmanager.  Had to use a funny hack to
implement singleton pattern.  May reconsider this usage eventually.