Add functions to order an object or array and to turn an object or array into a tree