Reconfigured flattertree into mongoose plugin