migrated compressor code Compressor class to compressor.js file