Global refactoring, cleaning, restructuring, bugfixes. Remove absolute pathes