Serialize special types

Serialize colors and urls as strings and use bytearrays for the other
types.