Added basic pgregress tests.
Merge branch 'pgregress' into json-type+tests
Added regression test for JSON datatype.

Also added code for outputing BSON dates to "MongoDB Extended JSON" [1]

[1] http://docs.mongodb.org/manual/reference/mongodb-extended-json/
Code cleanup.