Cleanup of tools/*

Refer to the commit comments for details.

Review by @paulp