Introduce linear function object

The linear function from #162.
Additionally extended the test utilities.