Added doctest and method description in context.py

Added doctest for method textFile and description for methods _initialize_context and _ensure_initialized in context.py