Added cache code

- Added some functions to splay tree that deal with empty splay trees
- Added cache implementation