TS-2646 regex_remap: Add an option for @caseless, case insentive regexes.

Cleanup, and allow (some) config to work without parameters. Also adds docs.
TS-2646 Make the overall code slightly less hideous