store scripts and related objects in static rails vars

This gets the puzzle page down to 0 queries for anonymous users
Merge pull request #182 from code-dot-org/cache_queries

store scripts and related objects in static rails vars