added cors model for dynamic cors settings

Allows middleware to pick up cors domain settings from a specific model. Added tests and passed.