Add typedefs on some public enums

Apparently this makes things easier to bind in some languages.
Docs for git_libgit2_opts and cache disable tweak

This adds docs for the cache control options to git_libgit2_opts
and also tweaks the cache code so that if the cache is disabled,
then the next time we attempt to insert something into the cache
in question, we will actually clear any old cached objects.
Typedef git_config_level_t and use it everywhere

The GIT_CONFIG_LEVEL constants actually work well as an enum
because they are mutually exclusive, so this adds a typedef to
the enum and uses that everywhere that one of these constants are
expected, instead of the old code that typically used an unsigned
int.
Clarify GIT_DIFF_INCLUDE_UNTRACKED_CONTENT option

This improves the docs for GIT_DIFF_INCLUDE_UNTRACKED_CONTENT as
well as the other flags related to UNTRACKED items in diff, plus
it makes that flag now automatically turn on
GIT_DIFF_INCLUDE_UNTRACKED which seems like a reasonable dwim type
of change.
Add ~ expansion to global attributes and excludes

This adds ~/ prefix expansion for the value of core.attributesfile
and core.excludesfile, plus it fixes the fact that the attributes
cache was holding on to the string data from the config for a long
time (instead of making its own strdup) which could have caused a
problem if the config was refreshed.  Adds a test for the new
expansion capability.
Merge pull request #1608 from arrbee/various-cleanups-and-tweaks

Various cleanups and tweaks