Add mime support, refactor file listener loading