Add tests for matching MIME magic numbers
MagicDB.match() raises IOError for files it can't open
Refactor code to match filenames.