Fixed carousel so it can be used with ng-repeat without refresh().

Squashed commits.