Cleaning

- some refactoring and error checking
- closing by presence of stop file
- testing on standard keyboard
- resetting change timer