tool related files to tool directory, socket releasing, renamed some tests