Add RegisteredMessage class

This class checks if the CheckMessage function exists and caches it to
improve performance. Used instead of storing Types