make metadata storage pluggable

I'm not sure I understand the reason for replacing backslashes in the payload. A comment would be worthwhile.