Fixed a few errors with db prefix, added automatic definition of yii and application paths