Basic implementation of CORS
Merge pull request #2794 from Manishearth/cors

Basic implementation of CORS; r=jdm