Added initial support for serialization.