Templating

The work here transforms the CGI application into a CLI-based application which could be run in a cron or manually when needed.

I have not sample output so I have not been able to fully test it.