Modified getTree() to support options (like context) as getChildIds()/getParentIds()