Rejiggered btree to be generic, and renamed dynarray to array.