add output_type option when calling export
restructure and create skeleton code for epub export