Use angular JSON methods for socket ops

Changed conversion of incoming/outgoing data to angular specific JSON methods. Especially removes $promise / $resolved variables that otherwise cause issues when inserting data in databases (i.e. mongodb).