Small error fixes
Add gen_diff tests
Start consdiff_apply_diff tests, fix some error leaks
Add more apply_diff tests, fix another leak
Last round of apply_diff tests, another leak