Some preliminary work to fix js/#36
Promote as-patterns. Fixes js/#20