JS templating using data objects and infinite scroll