Client_id is now passed to getDefaultScope().

Should deal with parts of #294 and #312.

New PR that supersedes #304.