port gamepad API

Still haven't tested it. Preliminary thoughts?
The return values from these don't make much sense.