Add beaker tests for functions.

Writing the tests is a WIP, but we can merge ones already written.