Add functor util
Allow State.continue_session and State.send_reply to be both functions and non-functions