Add option to enable a simple CORS implementation for the api server

Related to https://github.com/GoogleCloudPlatform/kubernetes/issues/1128
Recommend moving this regexp compiling into a function that can return an error, and make the cors function take the compiled regexps.