Allow 'rootElement' to be specified as a selector

As requested by @georgecrawford.