various documentation changes after having a think about some bits
moved a bunch of regexes into a shared library