Bug fixes and improvements

Improved :scope replacement by fixing regular expression and selector replacement.
Declared a variable as local that was identifying as global.
Enabled the ability to run query selector when the parent node is a document fragment.