Removed Reflection for constant checking and implemented defined()

A small feature to avoid the use of slow Reflection methods.

Sorry for the code reformatting 8-)