Significantly improved rebalance().
Added cycle.all() for getting resources back out again, if you wish.