use window.location for host / port defaults
navigator.online check breaks connecting to localhost
improve variable names
fix bug where nested objects were not wrapped properly for dnode