Javascript back in, more template cleanup