Apply jQuery conventions for document.ready callbacks

The jQuery recommended way of hooking document.ready is $(function(){ .. });
This commit touches the java scripts to apply this pattern.