[new] Complete rewrite
[test] Remove old test. Not compatible with the new API.