Remove main clauses from driver code
Begin templates module in backend
move template to templates
Update driver to use templates & clean up device_code