add merge sort function

In order to achieve o(log n) in finding a key within a page, we sort
the key and store the offset in the page’s metadata.