`quote`: Use a `RegExp` to replace control characters

jsPerf: http://jsperf.com/json3-tests/3
@kitcambridge please review.