Complete overhaul: faster, less code, and fully working as far back as GHC 7.0