Correct bugs with proxy generation and scope.

Convert the scope attribute to a string so that it can be serialized.
Ensure that the namespaces generated by the proxy stores don't have a leading \.