Ensure that the parent directory `a/b` for modules with names like `a/b/c` exist

Credit @jezstephens; fixes #168.