Final checks for script existence prior to switching protocols.

* moved checking URLInfo prior to constructing websocket
* changed how websocket Server is created to prepare for origin checks