3.0 treebehavior fixes

Fixes https://github.com/cakephp/cakephp/issues/3951

Also, changed the Table bake template to not use arrays for `primaryKey()` when there is only a single value. This will be the case in the majority of cases so using arrays from the user perspective is just a big hassle.