Various fixes and changes

Fixed bug where ManagedStack crashed if it was clear()ed more than once
Removed OwningGenerator and related code.
Generator can how own the functor, by moving it onto the inner context