#233 less repeated code
#233 cleaner selection of functions by mode
#233 catch pages without function links
fix TOC display for REST resources
#262 (element()|map:map)? => Object?