fix typo & update .npmignore
use path module to get extname
move files
fix bug of insertTempl
import insertTmpl function,higher performence