Move template sqr function to header.

Move template sqr funtion to header, has to be like this.

Wanted to be to fancy when moving from the user directory
Could you write it with space, i.e. "{ return t*t; }"? Thanks!