Fix non-interpolation quoting
Abstract a few conditionals
Allow specifying build directory on commandline