Convert writeForm(Data/Body) examples to unit tests and fix compilation errors.