Make most classes/methods final.

This is mostly an API change and not usually performance relevant.