Remvoed type.
Added namespace type key for fields to help prevent conflicting.
Renamed $key to $prefix. Thanks Brad!
Formatting.