Auto-detect gamepad names

Adds the getJoystickName function submitted as a pull request to Lime: https://github.com/openfl/lime/pull/39 (so this PR shouldn't be merged unless that one is)

Also threw in some minor optimizations to paletteMap that make it slightly faster.