Update async to the Python 2 / 3 compatible version
Update smmap to a Python 3 compatible version
Automated PEP 8 fixes
Pick off the low hanging fruit

This fixes most of the import errors that came from using the
implicit relative imports that Python 2 supports.  This also fixes
the use of `xrange`, which has replaced `range` in Python 3.  The
same has happened for `izip`, which is also being aliased.

The octal number syntax changed in Python 3, so we are now
converting from strings using the `int` built-in function, which
will produce the same output across both versions of Python.
Temporarily switch out async for testing

This will be switched back when the pull request for Python 3
support has been merged into the central async repository.
Test against Python 3.4

If it works in Python 3.3, it should also work in Python 3.4.
Considering it is the latest stable release, gitdb should be tested
against it.
Convert strings to bytes for PY3

In Python 3, the default string type is now the Python 2 unicode
strings.  The unicode strings cannot be converted to a byte stream,
so we have to convert it before writing to the streams.
Use memoryview instead of buffer

This uses memoryview by default, which is supported in Python 3
and Python 2.7, but not Python 2.6, and falls back to the old
`buffer` type in Python 2.6 and when the memoryview does not
support the type, such as when mmap instaces are passed in.
Better handling of bytes

This adds a `byte_ord` version of `ord` which will let `bytes`
safely pass through in Python 3.

`cmp` was also swapped out as it has been dropped in Python 3.
More bytes handling
Bytes for everyone!
Can't compare memoryview instances, convert to bytes
Making a bit of progress...

This changes the internals to use BytesIO over StringIO, which
fixed a few of the failing tests in Python 3.  We are only
importing from `io` now, instead of the entire chain, as this is
available in Python 2.6+.
Fix Python 2 failures
Start up compat and encoding files

There were a few things which were being reused consistently for
compatibility purposes, such as the `buffer`/`memoryview` functions
as well as the `izip` method which needed to be aliased for
Python 3.  The `buffer` function was taken from `smmap` [1] and
reworked slightly to handle the optional third parameter.

This also adds a compatibility file dedicated entirely to encoding
issues, which seem to be the biggest problem.  The main functions
were taken in part from the Django project [2] and rewritten
slightly because our needs are a bit more narrow.

A constants file has been added to consistently handle the
constants which are required for the gitdb project in the core
and the tests.  This is part of a greater plan to reorganize
the `util.py` file included in this project.

This points the async extension back at the original repository
and points it to the latest commit.

[1]: https://github.com/Byron/smmap/blob/1af4b42a2354acbb53c7956d647655922658fd80/smmap/util.py#L20-L26
[2]: https://github.com/django/django/blob/b8d255071ead897cf68120cd2fae7c91326ca2cc/django/utils/encoding.py
Fixed a few more encoding issues

Bytes should always be returned from the streams, so the tests
should be checking against byte strings instead of text strings.

This also fixes the `sha_iter` as it relied on the Python 2
`iterkeys` which has been renamed to `keys` in Python 3.
Convert types to bytes

This makes it easier to deal with things internally as now
everything is passed as bytes.
Minor adjustments to adapt to changes in async (due to be removed anyway)
Merge branch 'issue_4' of https://github.com/kevin-brown/gitdb into kevin-brown-issue_4

Conflicts:
	gitdb/db/ref.py
Made sure xrange is used instead of range in python 2

range in py2 will return a list, which can mean a lot of time and memory
is spent on generating it even though it's just used for iteration.

Simplified implementation of MAXSIZE