code style fixes
* added some coomments
* rewrited sql-queries
* changed debug LogToFile to PrintToServer
removed logfile
all LogToFile was replaced by PrintToServer or LogMessage/LogError
renamed some sql-callbacks