Added export-csv and refactored export-json using standard libs