Remove ununsed code
Moved almost all js to modules