Changed to doc.ready

Update to doc.ready to support post loaded use cases.
Merge pull request #31 from gbenvenuti/patch-1

Changed to doc.ready