Removed reliance on a global variable (bad practice)

Instead of using a variable to store module changed it so it uses normal angular module registration.