Waits until document ready before initializing.