Added spider true/false statement so that 404 pages and preview pages are not spidered
Added a check so that Horizon JS is not loaded on a preview page or a 404 page