Include projectId in Ref.Local.

Other tidying and minor improvement.
Added some toString()s.
Added Ref.global() for consing up a global ref.
Starting to bring it all together in Codex.