Add better Python 3 support

This adds Python 3 support without relying on 2to3. This allows for
easier testing on Python 3.3.
Remove unused imports
Use locale.getpreferredencoding()
Merge pull request #17 from myint/python3

Add native Python 3 support