Adding various fixes for CORS request/response handling

There are a few tests that verify that a SockJS server responds with
proper CORS HTTP response headers. Some of these test do not send
requests with the appropriate CORS request headers which could mean that
servers that follow the CORS specification [1] might fail the requests by
not sending back CORS repsonse headers

This PR attement to fix this issue.

[1] http://www.w3.org/TR/cors/#resource-requests '6.1 Simple Cross-Origin Request, Actual Request, and Redirects'
Can you add parentheses to make this logic clearer?