Rationalize `build` and `hack` directories

This also enables incremental builds for dockerized builds.

Fixes #1729
This is already set in the start, is it still needed here? Though I guess it doesn't really hurt...