Legacy JS Cleanup and proper documentation finally