This is unfinished. I got it rotting in a private repo for quite sometimes… GitHub is a better place.