Fix imports to work with both python 2 and 3