add in task managing functions

add in task managing functions; separate header and footer; add
config.inc