Added basic templating and unittests thereof.