Split commandformlib.c into separate files.
Fix incorrect memory allocation for field labels.
Improve handing of memory.