Update Callback Behavior

I modified the way the callback is handled to prevent it from firing before the new stylesheet is loaded by attaching it to the link element via .onload. "i" and "width" were made "global" to accommodate this. 

It might be desirable to include a check to see whether the browser supports .onload for link elements, but it seems sufficiently well supported so I didn't bother.