minor bug : UI countdown timer is not exactly synchronised with the time
of the alarm. Did some optimisations, but bug is still there
Fixed the sync bug. Also fixed a bug where the countdown would stop when the device goes to sleep.