bugfix to handle null and undefined; add explicit text() and html() functions as simpler alternatives to value()