refactor: declare components as global variables inside a self-executing function

The service and the directive are now global variables. By this way, the components are more testable (specifically utils functions).
A self-executing function is added by Grunt to avoid name collisions.