Refer to http://enreeco.blogspot.it/2014/10/salesforce-lightning-loading-scripts.html