Restructure and polish docker code to fix a package tangle and provide better separation of concerns.