Fixes #4675 adds a wrapper around the 3 variables passed into views

This is #314 rebased + handling of __toString on objects + performance improvements in views + unit tests.

Unfortunately I added my work in the middle of the rebase process (there was a view conflict) so it was squashed into @cash's commit. I probably should go back and separate those :/

Not sure how to properly integration test the usage in the view, but it's probably OK.