Add code for save/restore plugin state

Taken from ExtraNotes, should handle base64 serialization of
BlobParameter correctly.