[bugfix] - ensure metadata is saved/retrieved

Metadata was not being saved with the proper term. This fixes that and
also moves the #meta{} record into rafter.hrl