Add error logging capability
Make UI smoother

Doing the slow operations outside of UI thread
makes the UI a bit more responsive when
scrolling triggers load.

For some reason, implicit func2runnable conversion
does not seem to work, as if it would run the
other lines than the last one in the original thread.
Implement func2runnable conversion correctly

Thanks http://stackoverflow.com/a/3073712
Now Idea also shows that the conversion applies
to the whole block, not just to the last line.