Added Logging and User Groups management. Some bugfixes and optimizations.