Added onGround

Added onGround function, and slightly simplified control logic using it.
Move "player" to state rather than behaviour.