Refactoring size calculation into a specifiable interface, instead of requiring clients to extend the cache in order to specify the size calculation algorithm. Also fixing a bug in Cache#put where a new value for an existing key would improperly increment the cache size.