Implement CORS

Currently, any web based client that wants to interact with the server needs to have a server-side proxy due to the same origin policy. This sucks because I want to make a purely client-side web-based client (so the entire client would basically just be an HTML file).

This pull request implements cross-origin resource sharing to allow access from all domains (or specific domains in the config).