Add support for thin packs

We do something similar to git, which is to let whoever created the packfile figure out the bases and we simply put the missing bases into the back of the pack.