Added test for option with tags and regexps.
Refactored.
More refactoring.