optimize code

1. remove unused code
2. refactor all handlers
3. optimize the support of CORS
4. fix some logical mistakes(about application control: launch, join)

Signed-off-by: Manson Li <manson.li@matchstick.tv>