Performance improvements for the samples app

Stored the snipped tree in memory for faster access
Moved up the LibraryServlet script tag and added a flush so that dojo starts loading immediately.