Add handle_query method
Add handle_query method

There was too much code redundancy between —filename mode and regular
mode; the handle_query method is now used in both modes.

nicolewhite/cycli,nicolewhite/cycli