Add CommonJS and spm support