Some cleanup. Introduce parseBlock that parses the token stream until one of the ending tags have been reached.