Packet serialization & unserialization

They can be serialized and unserialized conveniently.
Also the makefile now uses C++11 by default.