Hacky fix to the problem of leaf files being inconsistently located relevant to tree directories.
Lots of work on getting the sample manager class to do everything it's supposed to do.:
Bring into line with changes to sampman.
Rather extensive refactoring, eliminating the ubiquitous multitree argument.  Most functions are now defined in terms of one tree, and multiple tree stuff is done using loops.