Add bulk-loading functionality with an example file.

It ain't pretty. For sake of simplicity the almost same code is now there
twice - one is just building an RTree in memory and stores it to disk.