massive refactoring to split files in reasonable chunks, resolve symbol namespaces at IR compile time