Added upsert support when updating with a document. #399

Should close #399.

Usage

```php
$newDocument = new Document(1, array('field1' => 'value1updated', 'field2' => 'value2updated'));
$upsert = new Document('', array('field1' => 'value1', 'field2' => 'value2'));
$type->updateDocument($newDocument, $upsert);

//OR
$newDocument = new Document(1, array('field1' => 'value1updated', 'field2' => 'value2updated'));
$upsert = array(array('field1' => 'value1', 'field2' => 'value2'));
$type->updateDocument($newDocument, $upsert);
```