BUG Fix JS issues in treedropdownfield for link editor

Addresses the internal link component of issue #1954.

Line 117: node will always resolve to true even if there are no elements in the jQuery object.
Line 125: Similar problem to 117, it will always resolve to true if the tree has been previously loaded. The :empty test is used elsewhere for exactly the same reason.
Line 126: If the tree is too large it won't necessarily open up the requested page and cause the page title to be displayed as "[Object object]"