port gamepad API

Still haven't tested it. Preliminary thoughts?
Need to handle controllers connected before init.