functional (mostly) script.py and added example template "foo"