This commit also starts to add unit tests. The API, as tested, works. The simplereader.c example is probably broken and will be fixed later. Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>