can't assume this is always window.

Got error when using module with bower an browserify.
format html template field
Merge pull request #13 from dreadjr/master

add AMD support