Initial check in

Moved code from private repo to this one. Untested.