Common tree-builder code to SharedTree

Move a big chunk of common tree-builder logic into
SharedTreeModelBuilder.
Could probably move a bunch more with a little work - all the bits after
buildLayer() are identical except for the GBM prediction logic
("ares*(1-res)" was not precomputed by the Histograms, while for RF the
prediction is just the mean which IS precomputed by the Histograms)
Move scoring into the SharedTreeModelBuilder

triggers a bizarre bug with javac; dies early...