yii2 module updated

Ported Yii2 module from master, with some BC. Tested on `yii2-basic` works fine. Related with this issue - https://github.com/yiisoft/yii2/issues/2317