Whole bunch of stuff

 - Fixed directory listing code for Windows.
 - Changed line endings in everything from "\r\n" to "\n".
   I've tested this on the Windows console and it worked. If there's any software configuration for which
   this fails, I'm gonna change `debug_print` to translate "\n" back to "\r\n" at runtime.
 - Added some simple UI elements for selecting a file (needs more features) and typing text. I've left a text input thingy in the main menu for testing.
 - I've fiddled a bit with the map editor, because I have the memory of a goldfish and can't handle more than
   two screens worth of function at the same time.
 - Gamepads can now be plugged in and unplugged at any time. At the start or after the active one is unplugged, the one which first reports an event (button, axis or d-pad) is activated. If a new controller gets connected at any time, it is also activated.