functions: Generate functions dynamically from a list

This reduces the boilerplate code that is needed to define new functions.

Works with both documentation generator and unit tests!