generate({moduleName: "compiler.parser"}) creates default parser variable

When using `generate({moduleName: "compiler.parser"})`, the default `parser` variable is created in the global namespace instead of attaching to `compiler`. When checking for a valid moduleName in `generate()`, the regular expression does not include `.`. This pull request adds that to the regular expression and updates the test case to use `generate` instead of `generateModule`.