Implemented pause functionality in G-code and refactored end
functionality.