1. Phase 1 : Forcibly moved some global functions/variables to classes.
2. Minor container changes.
3. MCommandWriter's buffer size is defaulted to 1024 from 4096. too enough.
4. Some more extra fixes.