minLevel problem fix

If you want to get a tree with parent, which is not level 1, you needed to manually adjust minLevel to parent's level to get any result. Otherwise, it crashed on arr[nextIndex] undefined. This commit fixes the problem by adjusting minLevel to parent object's level(rootLevel)+1 if neccessary. 

Just disregard the objectId commit, I don't have more time to do this pull request properly, maybe just for inspiration - you might run into this issue as well.