Replace subbuffer and copy vmethods by a more generic transform function that
can then be parametrised by transform specific data. This should allow us to
implement make-writable and more future transform functions.
Make separate api for getting and adding metadata. This allows us to pass extra
parameters to the init functions when creating metadata, which is needed for
specific API implementations.
Add beginnings of memory metadata.