Rework of export module to better handle possible scenarios and to alow code reuse. Also added direction to choose which data to export.