process.cwd() used instead of dirname, fixing file locations. Fixes #4