More javascript fixes, better portability, fixed thread viewer.