Update tests for python3 compatibility

Updated all tests for python 3 compatibility, have put the container_cmp_sort tests behind a < python 3 guard as the cmp keyword was removed, and therefore these are redundant with >=3.0.