Optimize the hell out of it

Reduce unnecessary computation
Massive use of constants to speed things up
Get rid of duplicate specs
Improve documentation