Fixed PHP-1013: Read preferences are not respected with command cursors.
Fixed a broken test with a hardcoded port.
Tidy up test cases a little.
Merged pull request #616