Defining ag/with-patch-function rather than using flet.

Fixes #78.