Updated to template version

1. Update to template version
2. Delete _old(test version) and .cpp for template
3. Currently only test for the int type