security fixes and js file reorg