refacture existing s2s implementation and fix various bugs
format server.js
add example
proper stream id generation