Improve GD function detection
- Create constants for the function names that we're testing
- Move function array declaration outside of foreach()
- Drop the !isset() calls because it was broken, and it's also
  unnecessary since all the values are guaranteed to be initialized.