a more efficient check for presence of Document class when setting Instr.dir
pathUtilities: remove dependance on Document class which is now tied to the IDE