Add methods to repo to get objects of a certain type.
Now get_blob etc. will ensure that you get an object of the type you want. There needs to be the addition to get the type by going via a higher type where possible, e.g. tree from commit, but it's not done yet.