move all js stuff to template bundle, upgrade angular and fix some upgrade errors