Disable tool groups when all its tools are disabled

Also add an option to make this behavior optional.

Change-Id: I13557f80c5567a4aaab3294371a7dcbf2d3e1184
Merge "Disable tool groups when all its tools are disabled"