Added $metadata to stored objects. This closes #4.