Introduce a temporary cache

When multiple similar queries are used in sequence (e.g. from picturefill), the inserted style tag seems to cause exponential delays (at least on Android 2.3 browser). This caches the query for the duration of the current JS thread.