Added nonce, moved scripts to footer