Fix errors and most deprecation warnings

We still need to update Opts to use structs instead of records, but that's a big enough change for it's own PR.