Create functions and test for creating type and message dicts.