Document function.h

Added much needed documentation.