Speedups

These commits implement the suggestions in https://jira.mongodb.org/browse/PERL-129, for a 65% speedup for inserts and 14% speedup for fetching (using the insert.pl script in the ticket).