get rid of defines and use consts
more conversion of macros to types
more macros to enum, the namespacing is annoying in this case... I'll figure it out later