refactor example value generation and fix a couple of bugs
refactor example value generation and fix a couple of bugs

Besides simplifying the code, this refactor does a couple of things:
1) Fixes an issue where example values are generated with type string
   instead of *string.
2) Provides all the required properties to avoid dereferencing any nil
   pointers when encoding an item while saving it to the db.

Clever/wag,Clever/wag