CORS functionality for jsDAV

This is a slight update to John Barton's CORS plugin made to work under the 0.3.0 plugin architecture. It also contains a few cleanups.