Get sockets to work, major data refactor