Cleaned up caching tests
Added functions for grouping cache keys together

Added some tests to drive thread safety