(PUP-1799) Restrict function base classes

There are assumptions throughout the system that functions are derived
from Puppet::Pops::Functions::Function. This adds a check to ensure that
any functions that are created are derived from that.
(maint) Rework documentation for functions

This moves around and rewrites large parts of the documentation for
functions to try to make them a little more clear about how to use
functions. It also makes the functions show up properly in yard.