moved metadata handling to a more general and extensible set of code + fixed a minor bug with loading magazine state...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>