create_reference, drop the symbolic param (#213)

Now we figure out whether it is a direct or symbolic reference based on
the type and value of the target. This guessing will fail in very very
rare situations, for that we still have the explicit lower level API.
docs: fix/improve references chapter a little bit
Check errors on module initialization
split create_blob_fromfile into fromworkdir and fromdisk to match libgit2

Both create loose blobs but fromworkdir assert the file is inside the working directory.
Merge remote-tracking branch 'bors/v0.18.1'

API change:

- Rename Repository.create_blob_fromfile to Repository.create_blob_fromworkdir
Remove "del index[xxx]" from the API

Use "index.remove(xxx)" instead.
Fix Repository.create_blob_fromdisk
Add "len(treebuider)" to the API
Add merge-base method.
Add TreeBuilder.get and remove TreeEntry.to_object

Also, check errors from git_tree_entry_dup
Fix tests for Python 2.6
Rename "low level" reference creation methods

Rename Repository methods:

- git_reference_create          => create_reference_direct
- git_reference_symbolic_create => create_reference_symbolic
Remove all warnings during compilation.

- Many PyLong_FromLong changed into PyLong_FromLongLong.
- A long used as out argument for git_config_parse_int64 changed into a
  int64_t.
- Many len variables changed from int into Py_ssize_t. Removed some
  castings related to those variables.
- Functions py_str_to_git_oid(_expand) return a Py_ssize_t, which is the
  return type of PyBytes_AsStringAndSize. Error values are usually casted to
  int, since the only error returned from those functions is -1.
- Changed RefLogIter i and size fields from int into size_t.
- Marked to_unicode_n and to_bytes inline functions as "unused". Not all
  compilation units which include utils.h use them.

Tested with:
$ clang --version
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
Merge remote-tracking branch 'xtao/merge-base'
update documentation on creating blobs
Re-work the checkout API

New API:

  Repository.head = refname
  Repository.checkout_head(strategy)
  Repository.checkout_index(strategy)
  Repository.checkout_tree(treeish, strategy)

Changed API:

  # Before
  Repository.checkout(strategy=GIT_CHECKOUT_SAFE_CREATE, reference=None,
                      head=False)

  # Now
  Repository.checkout(refname=None, strategy=GIT_CHECKOUT_SAFE_CREATE)
Merge remote-tracking branch 'bors/create_blob'
Include git2/odb_backend
Include git2/remote.h
Added line origins for Hunks in Pygit2.Patch