Cleaned up CORS check and fallback.
Merge pull request #2 from pjackson28/updatecorscheck

Cleaned up CORS check and fallback.