Documented more code and implemented 'cache_lifetime' option