Bug 844426 - [email] Limit JS syntax to legal ES5 syntax

https://bugzilla.mozilla.org/show_bug.cgi?id=844426

I'm committing the changes under vingtetun's user since the work is his; I'm just porting them from his branch using "meld".