Prevent initialized constant warning

This commit adds logic to determine if a class constant is already
declared for a particular entity. If it is, it will use the already
defined constant instead of trying to set it again. This prevents
numerous warnings about already initialized constants for each entity
that is created.