Use Python 3.x syntax

First step towards Python 3.x support.