Partial fix. I need to spend more time thinking about how to fix it properly, but it does work.
Also, I *did* reformat input_controller.php a fair bit. If I'm going to work on this, I'm going to have to make it readable to me to get anywhere.