Update serialization routines
Add buffer serialization tests