Initial code commit

Comitting an initial straight port of the Java library.