More task accounting fixes.

 - Refactored internal task state
 - Added task lanch rate limiting
 - Ensure we rebalance tasks periodically