Starting to work on moving over to handlers

The main code is getting pretty nasty so working on
building out some general-ish handlers that can be
iterated over for determining if time passes, what
should happen if a key is valid and so on.