Improve templatetag (fixes #15, fixes #16)