Added unified begin-end sequences support.

Unified begin-end sequence is sequence that can have meaning of
begin or end block header/footer in dependence of its indentations.
Fixed error with closing triggers.

There was an error in indentation checker logic -- correction is
that in case we have closing sequence (f.e. \end{}) current line
must already have adjusted indentation in decrease direction.