Perform basic URL/output validation and consistify encode/decode behavior.
Perform basic URL/output validation and consistify encode/decode behavior.

Rather than look at the helper program's full output, we now only grab the
first word, and then use urlparse to check for a scheme to verify basic
URL-ness. Further, we make sure that none of the characters are a control
code.

Calls to decode() and encode() are now passed getpreferredencoding() to
match the rest of the codebase.

5monkeys/bpython