Clean up and restructure sources
Remove unused macros, config variables, and file