major rewrite of handkerchief.py

now with easier and proper templates, direct templating from api data
and a lot of cleanup.