Rewrite using Estira

Also fixes #5, #6, possibly #7, and #22 .