Remove cache_last_entry option, and optimize __contains__ method.