Added a test case for PHP-925, and also allow test to pick a master or secondary from a set.

It specifically does not return the full isMaster output, as the printjson
function outputs *extended* JSON, which includes things like ISODate. And of
course PHP's json_decode() can't do anything with this.
Fixed PHP-925: Reading a GridFS file from a secondary server using PHP requires write access.
Use sys_get_temp_dir() as per review.
Merge branch 'v1.4'
Merged pull request #547
Always send the options to the writer
PHP-903: Improve Stream Notification support

When a Stream Context contains a "notification" parameter we'll send
  notification_code = MONGO_STREAM_NOTIFY_TYPE_IO_INIT
  message_code =
    MONGO_STREAM_NOTIFY_IO_READ
    MONGO_STREAM_NOTIFY_IO_WRITE
  bytes_max = How much we are about to read/write total

During the read/write we'll send incremental notification per chunk
  notification_code = MONGO_STREAM_NOTIFY_IO_PROGRESS
  bytes_max = how much we are about to read/write total
  bytes_transferred = how much we have read/written so far

Upon completion we'll send
  notification_code = MONGO_STREAM_NOTIFY_IO_COMPLETED
  bytes_max = how much we are about to read/write total
  bytes_transferred = how much we have read/written total

We'll also send notifications for actions (CRUD/KILL/GETMORE)
  notification_code = MONGO_STREAM_NOTIFY_TYPE_LOG
  message = JSON serialized array containing several different keys
    "server" (array): Always available
    "type" (int): MONGO_NODE_xxx
    "max_bson_size" (int): Maximum BSON Size
    "max_message_size" (int): Maximum BSON Message Size
    "request_id" (int): The request number
    See below for more info about each action

  message_code =
    MONGO_STREAM_NOTIFY_LOG_INSERT
      Additional "message" JSON keys:
      "document" (array): The document being inserted
      "options" (array): Insert options (WriteConcern etc..)

    MONGO_STREAM_NOTIFY_LOG_QUERY
      Additional "message" JSON keys:
      "query" (array): Query to execute
        NOTE: Massaged for mongos
      "info" (array):
        "request_id": Request number
        "skip": numberToSkip
        "limit": numberToReturn
        "options": bit vector of query options (slaveOk/tailable etc..)
        "cursor_id": (always 0)

    MONGO_STREAM_NOTIFY_LOG_UPDATE
      Additional "message" JSON keys:
      "criteria": Search query
      "newobj": Modified object to store
      "options" (array): All options passed to the command
      "info" (array):
        "namespace": Document namespace to update
        "flags": bit vector of update options (upsert/multi etc..)
    MONGO_STREAM_NOTIFY_LOG_DELETE
        Same as LOG_UPDATE, except for "newobj"

    MONGO_STREAM_NOTIFY_LOG_GETMORE
        "info" (array):
            "request_id": Request number
            "cursor_id": Cursor ID to ask for more data

    MONGO_STREAM_NOTIFY_LOG_KILLCURSOR
        "info" (array):
            "cursor_id": Cursor ID to kill

    MONGO_STREAM_NOTIFY_LOG_BATCHINSERT
      "docs": array of documents to insert
      "options" (array): All options passed to the command
      "info" (array):
        "flags": bit vector of update options (upsert/multi etc..)

    In addition, all READ operations also return:
    message_code=MONGO_STREAM_NOTIFY_LOG_RESPONSE_HEADER
        "query": The query we got results for
        "info":
            send_request_id": Request number
            "cursor_id": The cursor ID this query created/operates on
            "recv_request_id": The Request ID
            "recv_response_to": The Request ID the server is reply to
            "recv_opcode": Request Type (OP_XXX)
            "flag": Any previously set flags on the serverbbb
            "start": Where this cursor is starting from
WS and uppercase macros and move them together
Reduce comment lines to 79 chars as per code review
Seperate declaration and assignment as CR
Remove trailing WS
Fix hardcoded argument count.. not all callbacks have 3 arguments :)
Fix argument order
Make json a optional dependency, used by default, with a fallback to PHP serialize
Merge pull request #519 from bjori/improved-notify-support

Improve Stream Notification support

* bjori/improved-notify-support:
  Make json a optional dependency, used by default, with a fallback to PHP serialize
  Fix argument order
  Fix hardcoded argument count.. not all callbacks have 3 arguments :)
  Remove trailing WS
  Seperate declaration and assignment as CR
  Reduce comment lines to 79 chars as per code review
  WS and uppercase macros and move them together
  PHP-903: Improve Stream Notification support
  Always send the options to the writer
there is no system.users collection anymore, and thats not what we are testing either
db.version() requires eval roles, irrelevant for this test
that error message is now multilines and totally crazy
we don't need to dump all this out, the order of it has also changed
helper function to dump out keys from an array