* modularize access to context/profile list.
* add command printm to print messages
* finish changing to macros for msgstats and msgflags
* modularize access to context/profile list.
* add command printm to print messages
* finish changing to macros for msgstats and msgflags