Eliminating beginPage() and endPage() in layouts

Sorry. My knowlege about Git are very bad. I make some proposal to eliminate beginPage() and endPage() for https://github.com/yiisoft/yii2/issues/1507