More yielding from

Add more elaborate tests of generators, make generators pass return values correctly, and refactor some unnecessary code.