Internal API work and preperation for full RegExp matching