Added StringTree and generic methods from old implementation.
Think about immutability!