Fix usage issue with baseURI + make the code more AMD clean, fixes #1766...

...1
This commit fixes an issue in IE10 and IE11 (which do support WebSockets).  The .baseURI is not valid in those browsers, so you have to have a more robust fallback and check.   The fix below was authored and tested against an actual websocket supporting server and has been verified to work.   I also spent some time and did AMD cleanup on the module, getting rid of dojox. dojo. and most deprecated API usage.   It now no longer forcibly expects a dojox. namespace and such.
hmm... those docs are wrong.  `require.toUrl` doesn't do as much as dojo/_base/url - e.g. resolve one url relative to another http://jsfiddle.net/asgfkavu/

is there another utility that does that now?