Fix for Regex lastIndex issue and support for :focus pseudo-class

In certain circumstances, the shared `pseudos` regex would not
reset its lastIndex back to zero, and end up missing a match.

My fix is an additional `pseudos.test()`, just to ensure things
are back to zero for the next rule.

Also added in `:focus` as another potential match.

Finally, removed unecessary var `idxs` and changed `replaceRule`
from being defined within the loop to just once, up top.