Move to Python 3, add tests for uniqueness.