Refactor swt specs to use a shared context

This is a rebased version of #497, with fewer intermediate commits that have broken specs :)