Fixes config pathes, headers, names
Rewrites importReferences and removes unneccessary mdirs