It's telling you that tl is not defined because you have masterTl in your function.
//switch this
var masterTL = new TimelineMax();
tl.to(trail, 2, {alpha:1, rotation: 360});
return tl;
//to this
var tl = new TimelineMax();
tl.to(trail, 2, {alpha:1, rotation: 360, transformOrigin:"center center"});
return tl;
Make that change and you'll be good to go.
Happy tweening.