massive rewrite ongoing. added basic socket functionality to send info to client.