Plugin refac

Mostly moving code around to better isolate functionalities.
Add a compile-time option to enable unknown task dumping.