converts html file into a js template object