Pause Option added, some refactoring

added Option to pause memory measurement while the GUI isn't displayed.
Also some refactoring.
Merge pull request #1 from Stratege/master

Pause Option added, some refactoring