Added cache length approximation.  Initial implementation of expiration algorithm.
Added test for expiration mode.