Set a program name during the preamble

Fixes #2450