Add back the ability to register a raw function as a Generator (Fix #427)