object: implement peel()

This simplifies getting one type of object from a higher-level one as
well as accepting a commit-ish or tree-ish.
object: allow passing a type object to peel()

Allow usage of a python type instead of having to use the libgit2
constants.