Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment.