Some desperately needed cleanup of passing the parameters around

Also fixes a bug where the choice of tree building algorithm would be
ignored and GNJ would be used anyway.