Remove automatic injection of scripts into layout and hardcode script tags into the specific views where they are appropriate, as well as move the injection of the sails.io dependency above the bodies of the views into which it is injected.