Fixed god awful resource handling system

Biggest overall change that you will see is that the distinction between
XML/binary is determined through file metadata instead of file
extensions, so it is way easier to keep all of your files in one place,
and also makes it much less of a hassle to convert.