General changes to code

Gcode generation uing templates implemented