redo python2 support with new approach that avoids replacing module with object