Much from the first part of this paper comes from this code base.