 
 test = ->
   async.waterfall [
-    setupTokens
-    setupDrive
-    listProjects
+    exports.setupTokens
+    exports.setupDrive
+    exports.listProjects
     ],
     (error, results) ->
       if error

          # google authorization redirect
          uri = url.parse request.url, true
          if uri.pathname == '/favicon.ico'
            console.log "http rejected #{uri.pathname}"
            response.writeHead 404, {"Content-Type": "text/plain"}
            response.write "404 - no favicon\n"
            response.end
            return
          console.log "http path #{uri.pathname}"
          code = uri.query.code
          response.writeHead 200, {"Content-Type": "text/plain"}
          response.write "Erp derp\n"

    "#{id}&format=json"]
  callback null, id, testLink, auth, client

exports.loadProjectFile = (id, links, auth, client, callback) ->
  console.log "loading project file #{id}." if exports.trace
  client.drive.files
  .get fileId:id
  .withAuthClient auth
  .execute (error, projectFile) ->
    if error.code == 404
      console.log "failed to load project file." if exports.trace
      error = null
      projectFile = id:id
    callback error, projectFile, links, auth, client

exports.downloadProject = (project, links, auth, client, callback) ->
  console.log 'project export links: ' + links if exports.trace
  request links[0],
    auth:
      bearer: auth.credentials.access_token
