Fix race condition issue when loading external JavaScript libraries, use CDN
Remove dead code