CBD-125: Implement insertion algorithm

This commits implements the insertion algorithm. The insertion
supports bulk insertion, i.e. adding multiple items at the same
time. This is faster than subsequent single inserts.

The reason for being faster is, that multiple nodes can be written
at once, before their parent node is written.

Here's a quick outline of the way it works. First you have a list
of nodes that all want to be added to the tree. You start at the
root node:
1. Get all child nodes
2. Loop through all nodes that should be inserted and group/partition
   them into chunks. All nodes that would be added to a certain node
   according to the choose_subtree function end up in one partition.
3. Not keep trafersing the tree in depth-first manner and start
   with 1.

Change-Id: I29e89ddd5fe3676789f5dcfa39f62a3bf2120c46
Reviewed-on: http://review.couchbase.org/21027
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>