Renamed define macros to be more specific to my code. Various cleanup