Refactor JS -> C#, General cleanup of project