Support Marshal interface for serialization

Marshal refuses to serialize a NBayes::Base because of hash default procs.
As a custom implementation is required anyway, use the opportunity to reduce
redundancy in the data hash by grouping by frequency instead of term.