Created config structure in common, and cleaned up main a bit.
Prepare paths before building.
Separated directory and Relaxe build code paths in main.