add basic socket server, crash logs, code cleanup