Module resolve logic: look for index.R if specifying a path leading to a directory