treat JSON array correctly

As of MongoDB spec, an array of JSON documents will insert each single document contained in array (bulk insert).
Changed object/array check

... to be more ressource-friendly!
damn typos...

Changed the test for JSON array versus JSON object.
Let the loop for bulk insert an array run within the context of an transaction for better performance.
Merge pull request #3 from webcss/master

bulk document inserts
cleanup
mongo query parser improvement
$regex criteria made more compatible