Sync with main development repo

Minor updates and cleanup, added stub for XInput support.