Add convenience method for running tasks on main thread