Fix for 3515

Fix & tests for #3515

https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/3515

I used (string) because it is faster than strval() and  there are no real benefits in this case.
Also enabled append and prepend to take null and other non-array/non-object values.