Added support for bulk inserts

Also added one test for checking about-to-be-inserted document validity (spotted by the way).