Move the public channel state API into a new module