Add unit test of templated factory.
Remove unused files.