Cleanup and simplification in the taskmanager and the local instances and mini cluster.