Added worker middleware support, plus test