Implement CORS

Just a plain simple implementation of CORS. I don't know much about Rails, so this should be reviewed.