Add writemime (closes #13)