Adds test for exec presering lastIndex. Closes #491
Merge #518 r=@tcr: Adds test for exec presering lastIndex. Closes #491