MDL-33653 fix preview links on calc qtype edit forms.

Also, refactor how we render preview icons, to eliminate duplication.