An example on using promises in a Titanium application