Refactor

- Extensive testing

> Finished in 0.07053 seconds
> 292 examples, 0 failures

- Abstracted code into functional areas. Reduced code duplication.
- Removed use of class variables so messages were thread safe.

Still some work could be done with the duplication of the munging methods, but need to get this out the door.