Horrible things to optimize the hell out of sequences

Each commit should be relatively self-contained and self-explanatory.

Fixes #459.