Multiple changes in ClientContext

- Refactored some functions into the common ancestor.
- Added client::ViewportOps.