WIP toward replacing C wrapper with pure Julia structs