A simple but flexible html template tagging function. Handles arrays, promises, and custom value encoding.