Reverse argument order for patterns and options

Putting the options after the pattern list seems more natural and
matches other implementations.
Add support for comment patterns
Optimize the array union function

Instead of concatenating the two input arrays and then selecting only
the first instance of every element, concatenate the first array with
the unique elements in the second.