introduce tojson methods and Exporter class