Currently we run some tasks on the UI thread that shouldn't block the frame, such as decoding images. This patch introduces a background thread on which we can run these tasks.