Bug 993768.  Patch is sort of a tag-team effort from jwalden and jonco.  r=jwalden, r=jonco, a=lsblakk

--HG--
extra : rebase_source : c4567dd3c4b3b4161ad45b4a55e769dbfe400fc6