Improve compatibility of rst snippets with Python 3

This fixes the ``ol`` snippet which uses the ``xrange()`` builtin and the ``em`` and ``st`` (strong) snippets, which use the ``has_cjk()`` function.