Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
And I confirmed it works as expected for the empty array:

```shell
$ testcases=()
$ set -- "${testcases[@]+${testcases[@]}}"
$ echo $#
0
```