Revert "moved functions to top level of module to fix Pool.map"

This reverts commit b2be04fbb6ede64bd5e8237a634259eb089cc857.
replaced concurrent map with par map