Changed controller definition to use a more modern AngularJS idiom.