Moved the templates to the Header Files

Fixed the linking errors