This needs to include validation that the given path is only a directory name and isn't a relative path. For instance, this would accept `moduledir "foo/bar/modules"` but the underlying code would fail.