Removed unneeded parameter, now uses cache in directory $opts['diskcache'] if diskcache is set.
Also some minor cleanup of indentation and code style