commands/query: Allow query to be read from stdin; refactor refname-->citekey

Allow query to be read from stdin.

Refactor "refname" to "citekey".

Signed-off-by: Marco Elver <me@marcoelver.com>