Avoid "fmt" in writer
Codec: more tests, benchmarks, change Contains to Index.