Adds serializeForm helper for views.