Extract common example helpers and reorg examples

This reorganizes a few of the examples so that the main function
comes first with the argument parsing extracted into a helper
that can come at the end of the file (so the example focuses more
on the use of libgit2 instead of command line support).  This also
creates a shared examples/common.[ch] so that useful helper funcs
can be shared across examples instead of repeated.
init example: deploy helpers, reorg
add.c example: deploy helpers, reorg
init.c example: deploy more helpers
add.c: proper frontmatter
cat-file.c example: deploy helpers, reorg
rev-list.c example: use common utils, reorganize
Reorganize rev-parse example
Clean up showindex sample
Format comments for use with docco
Update examples/README.md
A few formatting changes for rocco

I'm not too happy about manually inserting &lt; and &gt; but those get
output as html tags otherwise.
Fix typos
Merge pull request #1916 from libgit2/simplify-examples

Fix examples to make the important stuff more obvious