Protocol update

Re implemented some basic data handling shit, removed unused code.