Initial version of code with some tests and benchmarks.