Fix issue #47 - Better algorith for serialize diffs

Closes #47