changed readme and externalized some javascript