Good call on moving it outside the function, should help. But even after doing that it still isn't loading fast enough... So I left my polling hack in for now. Some kind of require() or server side dependency loading would be cool, this works for now if we want to roll with it.