changes to clean up BSTM from library_features branch on lp

This includes the changes I made in library_features to make
it easier to subclass BSTM and make it clearer what has to be done
to do that. Also it has the nice sideeffect that the subclasses
now are less cluttered.