Defining `var module` in the window scope creates a global variable. This should be avoided by using angular's chaining syntax. Pull request follows.