Add serialization, deserializaton

Add serialize, deserialize methods to utils.lua
Add send_all method