Template class fully rewrited, new Template class functionality, unit tests added