Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
The code you had doesn't work because it finds the `grep` itself.  The double `grep` works but is ugly.  I went with `pgrep` instead.