Some code refactoring.
Preparation for Gpio interrupts.
Finalising "button" application.