New autoloading strategy

At the beginning well known paths are checked, then cache file and at
the end LIB_DIR.