Let the extension decide the best time to insert all JS. Other minor edits.