Reorganize diff code into functions

In preparation for more changes to the internal diff logic, it
seemed wise to split the very large git_diff__from_iterators into
separate functions that handle the four main cases (unmatched old
item, unmatched new item, unmatched new directory, and matched
old and new items).  Hopefully this will keep the logic easier to
follow even as more cases have to be added to this code.
Update diff handling of untracked directories

When diff encounters an untracked directory, there was a shortcut
that it took which is not compatible with core git.  This makes
the default behavior no longer take that shortcut and instead look
inside the untracked directory to see if there are any untracked
files within it.  If there are not, then the directory is treated
as an ignore directory instead of an untracked directory.  This
has implications for the git_status APIs.
More tests for diff untracked directories

This includes more tests for various scenarios when diff includes
an untracked directory in the workdir with contents either ignored
or not.
Update comment for clarity
Fix some formatting inconsistency
Merge pull request #1507 from arrbee/fix-look-inside-untracked-directory

Update diff handling of "untracked" directories
lol namespaces
merge!
renames!
move NAME and REUC extensions to sys/
Merge pull request #1523 from libgit2/vmg/namespaces

Namespace support
Set error message for branch functions

There were a couple of places where an error was being returned
from branch related code but no error message was being set.
Simplify error reporting
Make sure error messages get set
fix typo
Add error messages for failed submodule lookup
Merge pull request #1389 from ethomson/merge_trees

Merge trees
refdb: Proper namespace root
merge: Warning noise
allow empty dirs to exist when doing checkout