Enabled CORS XHR

Comment beautifying.
Added the Access-Control-Allow-Origin header to all responses equal to the origin of the request in order to enable ajax requests.