Changed slots in Demo to execute on a different thread.
Added fixes to allow test to compile.