Port of General Purpose PreProcessor to JavaScript