Tasklogs

This provides infrastructure and APIs for handling the individual logs created when running tasks.
The usage of realpath here is just to make sure that the identifier, when used as a filename, won't lead to some place in the filesystem not actually under LOGFILES_DIR, for example if there's "/../" stuff in there. There is no need really to tell the user what LOGFILES_DIR actually is, though. That shouldn't make a difference from their point of view.