Added templates

I templated everything in the header file and the cpp file. I am still
not sure how to get templating to work without combining the two files.
I believe M. Tuck has gotten this to work before.