generic cleanup
fix up variable names, exports. #note tests do not use `function' keyword...