Python 2/3 support

Making our python scripts work on python 2 and 3.