Reorganized Javascript and added Google Analytics