Restructure code to support in-place build/run.