Fixed bug when restarting game

Refactored Timer and Wave code