Add statically typed C++ implementation

Currently supports up to commit 6303a80 of the spec.