Combine regexes in arrays if possible

It is often useful to split up a big regex into separate logical
units. Unfortunately this is bad for performance, because the input
string has to be separately traversed for every unit.

This patch adds a simple optimization function, which walks through a
grammar and combines regexes that are split up in an array into one
single regex.

This can only be done, if the array contains only regexes, which all
have the same modifiers and no back references.
It is best explained with an example. If you start off with this array:
```js
'test': [
	'key.1', 'key.2', 'key.3', /regex1/
],
```
Then the strings are combined and get a `\b` added, because they are supposed to be keywords. I don't want to add the `\b` to every string. Instead I want to add them in the last step. But then I can't combine them with other regexes. So I do it in two steps. Next step looks like this with `i = 0`:
```js
'test': [
	/\b(?:key\.1|key\.2|key\.3)\b/, /regex1/
],
```
Without the `i -= 1` this would be the last step. Instead I decrement `i`. It will be immediately incremented again by the for loop, and the regex I created from the strings will be used as input. The end result is this:
```js
'test': /(?:\b(?:key\.1|key\.2|key\.3)\b|regex1)/
```