updates for simultaneous python3 and python2.7 compatibility

updates for simultaneous python3 and python2.7 compatibility

fixes to ensure no api changes between 2.7 and 3.x