Refactored FacetTree to support plug ins
Ported 'add to table' function to a plugin