First messy commit.

An ugly, working (with limited testing) implementation of bsdiff.