Update check_licenses and add it to CI.
This branch makes check_licenses pass without warnings, and adds it to our CI.
See comments for details on the exceptions we've made here, and also #493 (closed) for a somewhat annoying license situation.
Closes #462 (closed).