Do JS setup immediately when possible
Merge pull request #1571 from edx/db/js-main-setup

Do JS setup immediately when possible