Implement modifiers/flags

For example /i for case insensitivity. For this the API needs to be extended with [Flag] or some record.

They can also appear in the regex, e.g. a(?i)b, so the flags need to be kept in the ThreadState.