Use CTRL+D to exit query modes and console.

CTRL+D sends EOF to standard input. After being able to detect this with
editline, the console now exits the current command line mode upon receiving
EOF. The console exits when it receives EOF in main mode.

Resolves #34.