Port from Java to C#

Implemented in C#, based on (read: almost directly copied from ;) ) the Java implementation. The Java tests were also implemented using VS' unit test framework.

Included solution builds a class library which can be included in a project. Alternatively, the class files could be directly added.