Prepare for a new database format.

Copy the current PkgDB to OldPkgDB.

Signed-off-by: Magnus Therning <magnus@therning.org>
Use aeson for all JSON operations in PkgDB.

Replace use of json by aeson, for a couple of reasons:

 - easier to use, much more concise thanks to templates
 - interface using ByteString

Signed-off-by: Magnus Therning <magnus@therning.org>