Work on merging py3 code into master

This is to support both py2 and py3 on the same codebase until upstream
feels the need to drop python 2 support.

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>