Nawqaan 209

Although it looks like main.js changed completely, it's only because I removed the spaces and replaced with tabs. Real new code is from line 104 to 118.
This is actual a little trickier than this because of the way arguments are then passed to the functions in the "then" part. I'm going to leave this alone for now.