WIP: Probably eliminate most of this commit at some point.
Add process_state argument to handle_input.