Add keep-alive support, refractor ServerLogic
Merge branch 'feature/keep-alive' into dev