add tests around cloning functions

Many `clone` implementations fall short by way of:

- completely missing function properties.
- grabbing a reference to the function which means if you change the cloned function, the original is changed.

These tests are to:

- show potential reviewers that this function properly handles these well-known cases.
- help ensure that later changes/optimizations do not cause regressions for these cases.