Refactored context management into a manager class.

Signed-off-by: retep998 <retep998@verizon.net>