Made regex engine into separate module