Field creation logic now in a seperate function.

Prep work for field groups
Fixing bugs