Clean up code some, and fix lastpos to update it properly -- should always be the index of the last instruction added to the scheduled stream.
Clean up code some, and fix lastpos to update it properly -- should always be
the index of the last instruction added to the scheduled stream.



matthiaskramm/corepy,matthiaskramm/corepy,matthiaskramm/corepy,matthiaskramm/corepy