Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
I was just refactoring this from elsewhere.  I'm happy to fix it up though.