misc fixes.  most metadata populated
refactor to help with message tracking
message metadata tests