Some modifications and minor refactorings
added a very basic factory/adaptor for creating metric trees