adds support to generators

This pull request will add support to monitor generators, this was needed to make it work with tornado, which has generator based coroutines for asynchronous operations.
It will check if the returning type is a generator, and them wraps the generator into a iteration untill it raises StopIteration as a success, or a Exception as an error.