Merge pull request #1 from Tornchi/master

Bug Fixes
Fix compile error.
Add all remaining tests from the JavaScript implementation.

Also adds the functions missing for those tests from the C# implementation.
Improve test output.