Got basic pause feature working.
Refactored code to make pausing possiable. Pausing now works.
Merge branch 'issue16' into develop