Better object support (in particular ~ and & objects)

Fix #5762 and various other aspects of object invocation.

r? @graydon