new encoder without numpy, runs 10x faster
also timing info added to testencode() functions