Gameplay pipeline

Transforms Main loop into a step based pipeline, where each step is a function that will be called with the current tick.

Part of the work includes enhancing the hero leveling scripting during late game to be able to buy levels at a more rapid pace when appropriate.