Refactored the whole export and diff mechanism. Fixes #92 regression.