Extract control functionality to separate function

CTRL operations handle control of the app itself. This is in preparation
to making these scriptable.
Add a control entry mode

Control operations should now be completely scriptable, and are
triggered using the '%' character.
Add a filter_clear example to pcurses.conf