refactor(listener) refactor listener related code
Remove duplicate code around creating http listener.
Start to listen incoming http requests just before serving them.
Merge pull request #626 from xiangli-cmu/refactor_listener

refactor(listener) refactor listener related code