port gamepad API

Still haven't tested it. Preliminary thoughts?
The return values from emscripten callbacks should be nonzero to call `preventDefault` on the event or zero to not. Not entirely sure what this should do though.