Port WeakValueDictionary and Cache

- Port WeakValueDictionary and Cache
- Add CacheTest to test Cache class