store scripts and related objects in static rails vars

This gets the puzzle page down to 0 queries for anonymous users. Review: @brandonbloom