JS: Split JS loading and execution