make the CORS plugin completely independent

This makes the CORS plugin independent and all that should
be needed for it to work is to instantiate it, set it's options
and register it for events