A LOT of refactoring, gates now keep their scheduled ticks.