Add CORS middleware

Add middleware that sets the cross-origin-resource-sharing headers.
It also answers to pre-flight option requests. :)