work in progress
removed domain related stuff for now
completed first run of maintaining connections based on a ref count, and delaying end() calls to account for page reloads