Eliminate dependence of filetype.js on globals.