[#439] Split input.js in preparation for gamepad API