Dr writeresult

Relevant issues:

 * https://jira.mongodb.org/browse/PHP-1142
 * https://jira.mongodb.org/browse/PHP-1171 (adding on to what was done in #14)
 * https://jira.mongodb.org/browse/PHP-1172