Move 'withCredentials' flag to after the request is opened.  This caused an InvalidStateError when using IE and connecting to a website on localhost.
Remove trailing comma, which breaks older versions of IE.
Merge pull request #2 from corsairmarks/master

Resolve InvalidStateError in Internet Explorer when running on localhost