Fixed parse_group function

Function now uses recursion rather than incrementation.
DocStrings and Doctest implemented :)

Yeah, we pretty much did that.