Added a Prefix and Sufix so the resulting build becomes an anonymous function as it should be.
cleaned up some usage of explicit angular.forEach, angular.isDefined etc.