main.js now also checks for ducment.readyState in case DOMContentReady had already been fired