make load_task() accept function and class objects
load_task() refactored