Initial commit

First commit and first part of conversion from Python to C#.