Split js into different files and updated README