Basic implementation of diff and patch in pure python