Pause Option added, some refactoring

added Option to pause memory measurement while the GUI isn't displayed.
Also some refactoring.