fetch: use the streaming indexer when downloading a pack

This changes the git_remote_download() API, but the existing one is
silly, so you don't get to complain.

The new API allows to know how much data has been downloaded, how many
objects we expect in total and how many we've processed.
examples: port 'fetch' to the new API
transports: buffer the git requests before sending them

Trying to send every single line immediately won't give us any speed
improvement and duplicates the code we need for other transports. Make
the git transport use the same buffer functions as HTTP.
examples: run fetch in a background thread

This allows us to give updates on how it's doing
revwalk: return GIT_EREVWALKER earlier if no references were pushed

In the case that walk->one is NULL, we know that we have no positive
references, so we already know that the revwalk is over.
remote: run a callback when updating the branch tips

This allows the caller to update an internal structure or update the
user output with the tips that were updated.

While in the area, only try to update the ref if the value is
different from its old one.
config: also allow escaping outside of a quoted string

This limitation was a misparsing of the documentation.
Implement git_pool paged memory allocator

This adds a `git_pool` object that can do simple paged memory
allocation with free for the entire pool at once.  Using this,
you can replace many small allocations with large blocks that
can then cheaply be doled out in small pieces.  This is best
used when you plan to free the small blocks all at once - for
example, if they represent the parsed state from a file or data
stream that are either all kept or all discarded.

There are two real patterns of usage for `git_pools`: either
for "string" allocation, where the item size is a single byte
and you end up just packing the allocations in together, or for
"fixed size" allocation where you are allocating a large object
(e.g. a `git_oid`) and you generally just allocation single
objects that can be tightly packed.  Of course, you can use it
for other things, but those two cases are the easiest.
Convert attrs and diffs to use string pools

This converts the git attr related code (including ignores) and
the git diff related code (and implicitly the status code) to use
`git_pools` for storing strings.  This reduces the number of small
blocks allocated dramatically.
Convert revwalk to use git_pool

This removes the custom paged allocator from revwalk and
replaces it with a `git_pool`.
Moving power-of-two bit utilities into util.h
Adding stash to hashtable implementation

Adding a small stash of nodes with key conflicts has been
demonstrated to greatly increase the efficiency of a cuckoo
hashtable.  See:

  http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf

for more details.
Import khash.h from attractivechaos/klib
Convert hashtable usage over to khash

This updates khash.h with some extra features (like error checking
on allocations, ability to use wrapped malloc, foreach calls, etc),
creates two high-level wrappers around khash: `git_khash_str` and
`git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
then converts all of the old usage of `git_hashtable` over to use
these new hashtables.

For `git_khash_str`, I've tried to create a set of macros that
yield an API not too unlike the old `git_hashtable` API.  Since
the oid hashtable is only used in one file, I haven't bother to
set up all those macros and just use the khash APIs directly for
now.
Include the new config test file
Merge pull request #641 from carlosmn/networking

More Networking updates
Rename git_khash_str to git_strmap, etc.

This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to
`git_oidmap`, and deletes `git_hashtable` from the tree, plus
adds unit tests for `git_strmap`.
Merge pull request #642 from arrbee/mem-pools

Memory pools and khash hashtables
diff: fix generation of the header of a removal patch