Reorganazing code: move tcp and commands to main
One cpu by default