Refactor: tools,libs: Use g_list_foreach where it's easy to do so.
While we iterate over GLists in a ton of places, there are a
surprisingly small number of places that we can just swap to using
g_list_foreach. This patch makes the switch where possible. There are
various reasons why the others can't be changed:
- The for loop does more than just a single function call, and I didn't want to make a bunch of new functions out of the loop bodies.
- The for loop has a conditional that prevents us from iterating over every single element.
- The single function call puts its two arguments in a different order than a GFunc is defined, and it's a public function that cannot be changed.
- The single function call takes more arguments than just the loop element and a user_data style argument.
- The function being called varies for each element of the list. Essentially, something like ele->fns->whatever() is being called.