Export with json merged with notes

This covers #307 plus my changes for multipart notes.