promise basic structure

promise is created using var a = q.defer()

"a.promise" is the the promise object
"a.promise.then" is the then handler