Split Firefox preview code out into a separate module so it can be used for other file types.