fix & debounce resize; fixes #501
cache contexts; fixes #502