Refactored the JSON representation creation in the DSpace generator

Added also a parameter that defines if the JSON representation should
be written on the disk or not.