Generic binary trees in ES6 (casualjavascript.com)