Added MessageFactory, and implemented Message.Insert API.