(#510) - mandatory type argument

Revert the possibility to skip the type field on putAttachment.
(#510) - putAttachment create doc in one go: tests

Adds tests for creating attachment and doc in one go. Also adds tests
for when callback is omitted.
(#510) - putAttachment create doc in one go
Merge pull request #515 from daleharvey/510-putAttachment-create-doc

putAttachment should create doc if it does not exist