Dynamic OS detection. Compare logic. Refactoring.

These changes probably introduced some (very very minor) performance
issues. If you have millions of messages to parse, the next update
should fix your issues. This shouldn't cause issues for most people.

Also looking to add JSON support soon for a more lightweight way of
transmitting data.