Multiple fixes.

Add initial gamepad support. Remove some unused code. Ensure emulator
quits properly. Shrink analog pad size for better analog. Fix some
issues to save states.