Have `text()` accept a function argument

This is for jQuery compatibility. Makes it work similar to `html()`
and other methods that accept a function in their setter form.
Make `text(value)` assign empty string for `null/undefined`

Previously it would assign a literal string `"null"` for null, which
wasn't very useful.