Cleanup: Use an enum instead of defines for message types.
Cleanup: Stop using #defines in types.h and msgtypes.h.

Use const variables for normal defines and replace function macros
with inline functions.  The one exception to this is SUCCESS and FAILURE
which where left as macros because they don't have a clearly defined type.