Refractor the code for imgdiff

Put ImageChunk and some helper functions into a class. Also switch to
using std::vector instead of malloc.

Bug: 18606652
Test: imgdiff_test passed on host. Also generate a complete incremental OTA package.
The file content is the same and time consumption is similar.

Change-Id: Id603ada4e130ef521218400761a119001a86ca79
diff --git a/tests/Android.mk b/tests/Android.mk
index 3ab5ea6..9ee27a0 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -176,6 +176,7 @@
     libbsdiff \
     libbspatch \
     libziparchive \
+    libutils \
     libbase \
     libcrypto \
     libbz \