Pass contents to attachment scripts

Pass the text of the current window to document attachment scripts. This allows the scripts to either use the path information or the contents. If documentWillSave returns data, it will be used to replace the buffer. For documentDidSave it is ignored.