Use WeakMap to store view instances for elements

Degrades back to using jQuery data() API when WeakMap is
unavailable.