Reformat app.js
modify analyze function to return masterPromise

- function now returns an array with the master promise and the results
object
- master promise can be used to watch when the results are ready to be
worked with