Diffing algorithm.

Wrote the main body of the diffing algorithm. There are many
conditionals and it may be possible to simplify or refactor, but
it provides the framework for building out a semantic diffing
utility.