More tests.
Use value length to calculate the element size instead.
Add test for maxSize().
Remove old entry at key (if there is one) before adding the new one, or the cache size gets calculated incorrectly.