Added output buffering class with test cases.