Tweak CORS settings
Refactor test-only handler handling