Added support for "atomic" insert of documents with attachments

Hey,

Here's my suggestion of a fix for the race condition when adding documents with attachments. Basically, here's what's been done:

1) Changed signature of `DocumentWriter.insert` to:

```java
boolean insert(DatabaseDocument<T> d, DocumentFile<T>... attachments);
```

2) Changed corresponding implementation in `MongoDocumentIO` to set a metadata flag on the document to make `getAndTag` ignore it until all the attachments have been committed.

To understand the behaviour, I suggest looking at the new tests in `MongoDocumentIOTest`.

The other commits are basically a bit of cleaning to simplify the implementation.