rename getcwd to get_cwd to avoid C namespace conflict; add namespacer