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

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