Finnaly having hopping working in a decent way. Also removed some dead code from StateManager.