(#85) - actually implement multipart correctly

Just when I think I understand promises, something
like this comes along. This is probably the 5th time.

So obviously this "promise chain" wasn't working the way I thought, and not all attachments were getting put into the doc before db.put was called.