Add support for CORS preflight requests.

Fixes #39.