A fresh start never hurt nobody...
Copied over my reimplementation from Bixel repository.