Fixed duplicate importing

Import derectives weren't removed from cache, resulting in unexpected
output.
Also fixed importing method, allowing simpler configs.