Beautify spaguetti sample
First try on promises
Second try on promises
Simplified example for spaguetti code

I don't have time to build promises right now. We'll solve it in the dojo :-)