Splitting out js and jstemplates tasks to prevent race conditions