Fixed markup stack in order to correctly support void elements, refactored related code.
Added support for correctly stacking some of the elements that close their siblings (li, td, tr, th...)