Allow all functions to be returned. Refs #5779.
Improve `sys.list_functions` tests.