split the process function into 2 so that it can be called in Python

PR does the following:

* added `process_text` which can be independently called to process wiki text in Python vs calling the tool via shell
* fixed some pep8 violations
* added preprocessor parameter to `process_text` which is then passed to `run_preprocessor` which allows to pass custom preprocessor to the `process` function which can intern load custom templates - related to https://github.com/lambdafu/smc.mw/issues/8

also all the changes are backwards compatible