Add a common implementation for service-task

* Move duplicated code from server/renderer into core
* A small fix in the makefiles, regarding gmodule compile & link flags