A simplistic function for checking whether the DOM is ready in modern browsers.