Fix for #3515, functional extension & tests

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 assign(), append() and prepend() to take any values
convertible to string.