Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
If you keep this step by step with the temporary file, then in this case you only need `rm -f` and not `-r` since it's not a directory that needs recursive removal...