Added MainThreadExecutable to run some code on the main thread only.