Remove some unneeded stuff.
Generalise the promise infrastructure so it can be used for more than just backgrounding.