Added support for custom serialization of forms