 _ = require 'underscore-plus'
 {Emitter} = require 'emissary'
 fs = require 'fs-plus'
-Q = require 'q'
-runas = require 'runas'
+Q = null # Defer until used
+runas = null # Defer until used
 
 Directory = null
 PathWatcher = require './main'

    if not @exists()
      promise = Q(null)
    else if not @cachedContents? or flushCache
      deferred = Q.defer()
      promise = deferred.promise
      content = []

      fs.writeFileSync(filePath, text)
    catch error
      if error.code is 'EACCES' and process.platform is 'darwin'
        runas ?= require 'runas'
        # Use dd to read from stdin and write to filePath, same thing could be
        # done with tee but it would also copy the file to stdout.
        unless runas('/bin/dd', ["of=#{filePath}"], stdin: text, admin: true) is 0
