Add Python 3 support (and drop support for < 2.6)

Most of the credit for this goes to @bsidhom. I just took his Python 3 port and added a bunch of `__future__` imports and the occasional `from io import open` to make it backward compatible with 2.6 and 2.7.

I did some minor clean-up things like sorting imports and things like that. Oh and I added a `.gitattributes` file to ensure line endings are consistent.

@erikrose Are you still actively maintaining this? I notice there a few outstanding pull requests and I just want to make sure the version on PyPI is 2/3 compatible soon.