Moved javascript into dedicated .js file, clarified README a bit