make match safe

`String.prototype.match` returns `null` if there is no match. For example:

```javascript
> 'abc'.match(/x/)
null
```

This change is largely copied from #13.

Terrific explanation! Thank you, @paf31.