Refactored without logger, using prototype correctly, new message parsing function
More robust tests, which also now pass