EM refactored for better consistency when handling relative and absolute import paths