Refactored so that each field type is it's own individual module
(removed the switch statement in insertField)