Convert plugins to CommonJS and add tests