Undo a previous change whereby we were splitting initialization in two phases.
Move initialization to where it is possible.
Finish changing initialization orders. Fix a couple of errors in the previous code on the way.