Major improvements to library.html and simulation.html