Added mechanism to specify a constant for affiliate ID

To be used in the Extensions page. Fixes #482.