Rewrote ThingFunctionsImpl

Easier than I expected, actually -- almost no changes to
ThingFunctionsImpl itself, just enhancements to AutowireApiImpl.