Improve templates rendering and make Template class more testeable Signed-off-by: Rubén D <nuxsmin@syspass.org>