Update worker-thread branch with changes from master

Just merge across the changes from https://bugzilla.mozilla.org/show_bug.cgi?id=897308 ...