Check if constant exists before defining

This fixes problems when running tests with PHPUnit.
up version, whitespace change, add @kidk to THANKS