Moved some angularjs code which is only necessary on startup to the controller initialization. This removes some dependences between services, which fixes a circular dependency error in angularjs services.