Add support for assertions (NDEBUG in release).
Added serialization support and Command hdr.