Compatibility changes for stdin

Getopt in versions 2.6 and below do not consider a - to be a positional
argument and it is removed completely, which makes it impossible to
read from stdin. This just checks for a ‘-‘ in the argv and sets it in
the args if it wasn’t added.

Encode the data from stdin so version 3 doesn’t complain.

Check if stdin is a tty by asking it directly, the nature of sys.stdin
changes and os.isatty may fail.
Update README