Completed field definition factory along with some unit tests for that.