Added Python 3 compatibility
Fixed missing globals by borrowing them from the Jinja environment
Don't install test modules in site-packages