Reorganize the build directory

Closes #2302