Added message parsing logic with some basic unit tests