Fix errors in Thunderbird extension code; remove need for temporary directory