Added unit tests for operations model
* Refactors some gCode generating code
* Fixes issue #8