Add some preliminary cgo support.

Updates #16.