Switch changes module to an angular service to make unit testing possible.