Module path validation

More validation checks have been added to disallow invalid module paths.