Rewrite store method to a block-styled version

I was annoyed all the time, that open, writing and closing has been done
by different JSON archiver methods. Hence, I rewrite the store method to
use a block. The block passes the writer object which is then used by
the method caller to store the JSON objects. After the block everything
is closed properly.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Extend Yajl::Gzip::StreamWriter by write method

The original stream writer only offers a singleton method to encode IO
objects, but since I want to use it through the instance method and
write I have added the write method.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Write header for gunzipped dump files

The dump harvesting does not comply yet with the new standard. With this
commit a gunzipped dump is extracted and recompressed with the header at
the beginning of the raw JSON file.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Writer header for zipped dump files

The same as the commit before, but now for zipped files as it is the
case with the data.gov.uk dump.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Refactor further code of the harvester

Just unified a bit code and added again the method to flatten groups and
tags of a CKAN API harvested metadata record.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>