[new] Attribute can now be treated as function

This enables a shorthand access to the attributes' values by doing
something like $object->attribute(0), which is equivalent to calling
$object->attribute->value(0) .