validates package names based on CommonJS spec to ensure that they will be
legit as directory names