Support Firefox 31+ in the 4.0 branch

This updates the 4.0 branch to support Firefox 31+.

Mostly just promise updates as we had to do in other addons a while back.

However I also got error when trying to send custom events to the simulator dashboard page, so I just hacked that up to use `postMessage`. It's enough to get it working at least.

It's possible I've now broken the addon for pre-30 Firefox (that's the earliest I tested). Should I update the `minVersion`?