nincat: use new library facilities, support Python 3, and then some