bemhtml: introduce tree structure checks