Fix msgcmp order

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
Massive refactoring and completeness

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>