Refactor & fix a lot of bugs.

* Move state variables to be private members of the class
* Create a function for updating the time label
* Refactor time logic to fix some overflows
* Use QElapsedTimer instead of QDateTime for counting
* General coding style cleanup
* Properly reset state in reset()
* Don't let the modal message box have its own event loop
* Move includes to the header file & remove some predefs