These still need tests, but I thought I'd upstream so I can use benchmarking and check for build errors.