Add datfile scanning

Added datfile scanning. Currently only XML dats from redum. Also
included magic.py which is from some other project as sometimes the one
that comes with a distribution is shit and doesn't work.