Use improved stdio wrappers and input shim; use unicode_literals

In this branch, we will finalize development of our Python 3.3 migration strategy, most importantly Unicode handling.

- Use "from __future__ import unicode_literals" everywhere.
- Use "sys.stdin = io.open(sys.stdin.fileno(), encoding=...)". This makes sys.stdin behave like it does on Python 3.3, producing unicode without having to rely on hacks, implicit coercion, or external configuration to fix the Python encoding.
- Replace sys.stdout and sys.stderr using "codecs.getwriter(...)". We would like to use io.open() on these as well, but that would produce errors any time a byte string gets written to sys.stderr, and hide them. We can't fix the errors if we don't see them, so we use codecs (which accept either bytes or unicode text) as a migration strategy.
- Don't wrap the streams more than once.
- Replace raw_input() with a shim on Python 2, since it doesn't know how to flush the wrapped stdout buffer before waiting for stdin.