Checkout

This adds the `Repository#checkout` method to switch or detach `HEAD`, and `Repository#checkout_tree` to checkout all or individual files from a specific branch/commit/tag/revspec.

This superseedes #107, which has been outdated for quite some time.