Merge pull request #231 from mitya57/master

Add Smarty extension and use it for building docs.
Fix NameError in run-tests.py