js: binary tree using struct/obj