code cleanup
New MainText method based on preprocessor.py in order to better handle cases of unclosed tags, etc, for which the mediawiki parser is quite acceptant