Implement event handling for gamepads and joysticks. In addition, the events are ordered according to SDL compatibility.
Extract config-related code to their own source files.