add Cross-Origin Resource Sharing support

Implements #32.
/cc @rajivm @dlindquist for code review