Python 3 support (final commit).

All behave tests now pass under both Py2 and Py3.
Also fixed a bug where classes were used as a secondary sort key in select(). Python2 permits this,
though it's meaningless; Python3 rejects it.