Some fixes and code cleanups

In particular, the changes allow FontClustr to run with current versions of its dependencies instead of failing because of obsolete imports or API calls.