Adding dirname and filename node globals

These globals (especially dirname) are important for the sake of
interoping with Node.js libraries which often expect an exact path to a
file.