Cherry-pick "Refactor Regexp.prototype" am: 780b5e3420 am: fd88a6d57e

Change-Id: I078d8a3fe6a1fca3cd134ae53a9e89a3ca4fc99f