Add support for closures in profile definitions.