Add state to hooks, and add WIP on_read command
Fix bug in on_read command