- Some clean up for better maintainability
- Initial untested code for running plugins on text to be replaced