[PHP-638] Return constant string types in getReadPreference()

Replace numeric types with the constant string values and eliminate the irrelevant "type_string" field.

The change to mongo_read_preference_type_to_name() should also fix compatibility with mongos, as the "preferred" strings were not what the server expected in the cursor $readPreference mode.
[PHP-638] Test $readPreference modes for mongos cursors
[PHP-638] Make getReadPreference() tags consistent with those set
Merged pull request #259
[PHP-647] Check isMaster response for "secondary" field

Create a new connection type, INVALID, for when the connection type cannot be inferred (e.g. recovering secondary).
[PHP-647] Update tests for logging of isMaster "secondary" value
[PHP-647] Test that queries are not sent to recovering secondaries

Helper functions were ported from the Python driver's ha_tools.py module.
Merged pull request #256
Added an extra test case for PHP-637.

The code was working fine, but a very specific test case doesn't hurt of
course.
Added an extra test case that goes through writing/reading MongoDate.
Fixed typoes.
Merged pull request #257
Renamed macro to its upper case version and removed the variable declaration.

CS states that all macro names should be upper case. The embedded variable
declaration confused me and it can easily introduce "declare after code" issues
with MSVC.
Fixed PHP-656: Add host, port and node type to the MongoCursor::info() return value.

This is also mightily helpful for figuring out which host/port and type of node
the query was read from.  It's also useful for tests, notably for the tests of
PHP-639.
Changed force_primary to just set a flag on the cursor.

This means we no longer have to request the connection twice, and it also fixes
a bug that made the tests for PHP-511 fail.
Don't initialize cursor read-prefs in constructor or just before running the query.

Doing this allows us to modify read preferences after the cursor has been
created without special hacks. This is a pre-cursor to fixing PHP-483 but also
allows us to fix PHP-639 (this branch/PR). The read prefs are still set after
MongoCollection::find() created the cursor.
Fixed some test cases

Still issues with tags, but I don't quite know how to address this!
Fixed PHP-639: MongoCursor::slaveOkay() has no effect.

Set the read preference in slaveOkay on the cursor, besides
just setting the cursor flag.

Setting the cursor flag isn't strictly necessary, as we set it when
the RP isn't PRIMARY in do_query anyway.
Fixed MongoCursor->slaveOkay(false) and added support for MongoCursor::$slaveOkay.

In order to support slaveOkay(false), I've moved the parameter parsing into the
slaveOkay method and substituted the -1 (which means that parameters would be
parsed in set_cursor_flag too) for the value. If I wouldn't have done that, the
parameters would have to be parsed twice.

In mongo_cursor__do_query I moved setting the cursor opts to below the
new check for the static property value of MongoCursor::$slaveOkay, so that
its value is also taken into account.

I've also added a bunch of extra tests!
Move zslaveokay to a scoped variable.