Fixed Nil error for nested fields

Fields with multiple dots (e.g. "@fields.data.timeTaken") caused a Nil error in field_type due to collect_item_attributes returning an empty array.
This happens because the field string only substituted the first dot.  Converting from "sub" to "gsub" resolved the issue.
Merge pull request #318 from nslowes/patch-1

Fixed Nil error for nested fields