Added messages classes.
Improved tested and fixed some bugs.