Moves javascript to external file and enqueue's it on the right pages