Messaging Cleanup + Licensing Fix

Cleanup messaging interface
Fix licensing code for variable key lengths (was previously assuming 512 bits)