Only wrap generators

Currently all callbacks are wrapped, whether or not they are generators. This causes an exception when you use regular functions.