CORS + Fixes

Fixed some namespace issues and added support for Cross-Origin Resource Sharing: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing.

This is required to support connections from client-side JS API clients on different hosts, e.g. https://github.com/Concentra/Crosstalk-Demo