[wafbuild] A whole lot of stuff implemented, and then some fixes.