Reworked the hook/timer systems

Fixed timers not running. Finally found the damned problem. Turns out
table.sort was not sorting elements down to 1 and was generally not
working. So I've completely reworked the priority system and it's now
working as intended.
Merge pull request #73 from Person8880/develop

Reworked the hook/timer systems