Big rehash of build system