porting tests and examples to CommonJS style exposing