added support for EMC or Mach3 gcode output, selectable by a command
line switch