Mediawiki wiki markup as a token stream in Python