Move operator[] to DomTreeNodeBase

The comment in base even refers to it, but it was only defined
in the subclass.