module-manager: supports __dirname and __filename; adds test cases; fixes #113;