Add patterns.js javascript.

Includes the full bundle for now, should narrow down to only those parts we
require.