Merge pull request #3 from stannedelchev/master

Added C# version.  Thanks so much!
Some minor reformatting, and switch to Windows line-endings (boo).