Clean and consolidate export code #190

Restoring quantization...
Cleaning