Clone RegExp flags and set `lastIndex` if needed.

Closes #22.
Merge pull request #23 from diversario/i22-regexp-props

Clone RegExp flags and set `lastIndex` if needed.