backport workqueue and timer from mako