Huge improvements to build system