Changed BTree methods to use references where possible to avoid value-copying
Added lock upgrade capability to LockManager