Update contentloaded.js

for performance, make check for doc.addEventListener only once and store it in variable called modern.