Convert to a new-style extension

There aren't any tests in this repo, so I'm not sure it works, but there isn't much to it.