move doc.ready into modules

user of module should not need to know this, module should be self contained.