Made scope optional, fixed queing of ready msg

In theory the old code allowed missing scope, however an empty string
was then used as object property name in routing, causing routing to
fail. Now, if scope is missing, cfg.scope is silently set to
"__default".
Also, ready is set to true at beginning of onReady so that publish-reply
does not get queued.