Bugfix & small changes

* Splitted classes by modules
* Small refactoring of copypaste code (Messages & Database)
* (bug) fixed friends retrieve