added some BTreeIndex functionality. also added unistd.h includes for gcc 4.7+