use mimemagic, no more libmagic dependency