To be fair, I've never done a port, always a custom implementation. http://oursonic.org/ is my favorite personal project. You can see the source at https://github.com/OurSonic/OurSonicSharp
https://github.com/OurSonic/OurSonicSharp/blob/master/OurSon...
maps to
https://github.com/OurSonic/OurSonicSharp/blob/master/Output...
As a bit of self promotion, if anyone is interested in helping on this project, or any other web based c# -> js game, shoot me an email dested@gmail :-)