minor fixes
extract agent server
better handling of server shutdown
extract agent server launcher
remove obsolete methods
apply fixture test
fix server shutdown issue
start fixing synchronization issues
fix session communication issues

code is extremely ugly and will be refactored ASAP