Provide more constants.
Better commenting, removed debug code and formatted.
Utility methods to extract data from messages.