Tidy and rid unused modules
Enhance substitue regex

For features and clarity with tests to back it up.
Add file to run tests using local libs