Python 3 and unittests

I've added python 3 support and some test to make sure python2/3 builds don't get broken.