re-added nodeslice constructor for testing
refactored out makeTreeFromNodeSlice